<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>人员档案</title>
    <!--<link href="../../script/css/bootstrap.min.css" rel="stylesheet" />
    <link href="../../script/css/bootstrap-table.css" rel="stylesheet" />
    <script src="../../script/js/jquery-1.12.3.js"></script>
    <script src="../../script/js/bootstrap.min.js"></script>
    <script src="../../script/js/bootstrap-table.js"></script>
    <script src="../../script/js/bootstrap-table-zh-CN.js"></script>
    <script src="../../script/js/cus-grid.js"></script>
    <script src="../../script/js/cus-dirs.js"></script>-->
</head>
<body>
    <div style="width:100%">
        <table name="base_psersonalFiles"></table>
    </div>
    <script name="loadPage">
        var base_psersonalFiles_init;

        var base_psersonalFiles = {
        data: {
                data:[]
        },
        detailLink:[],
            rowbtns:[],
        toolbtns:[],
        cols:[],
        new: function () {
            base_psersonalFiles_init.editLoad('base_psersonalFiles_edit.html');
        },
        edit: function () {
            base_psersonalFiles_init.editLoad('base_psersonalFiles_edit.html');
        },
        del: function () {
            $.post('/api/base_psersonalFiles/del', { id: base_psersonalFiles_init.getId_edit }, function () {
                window.location.reload();
        });
        },
        mdel: function () {
            $.post('/api/base_psersonalFiles/mdel', { objs: base_psersonalFiles_init.getSelects() }, function () {
                window.location.reload();
        });
        },
        check: function () {

        },
        mcheck: function () {

        }
        };

        $(function () {
            base_psersonalFiles.cols = [
{field: 'code',title: '编号'}
,{field: 'name',title: '姓名'}
,{field: 'idcard',title: '身份证号'}
,{field: 'workingTime',title: '从业时间'}
,{field: 'mobile',title: '手机号'}
,{field: 'userid',title: '用户ID', visible: false}
,{field: 'personalType',title: '用户类型', visible: false,formatter: function (val, row, idx) {
                                            var str = '';
                                            for (var i = 0; i < base_psersonalFiles.data['personalType'].length; i++) {
                                                var p = base_psersonalFiles.data['personalType'][i];
                                                if (p.id == val) {
                                                    str = str == '' ? p.text : str + ',' + p.text;
                                                }
                                            }
                                            return str;
                                        }}
,{field: 'carNo',title: '车牌', visible: false}
,{field: 'postStr',title: '职务', visible: false}
,{field: 'iflag',title: '状态', visible: false,formatter: function (val, row, idx) {
                                            var str = '';
                                            for (var i = 0; i < base_psersonalFiles.data['iflag'].length; i++) {
                                                var p = base_psersonalFiles.data['iflag'][i];
                                                if (p.id == val) {
                                                    str = str == '' ? p.text : str + ',' + p.text;
                                                }
                                            }
                                            return str;
                                        }}
,{field: 'remark',title: '备注', visible: false}
                ];

            base_psersonalFiles.rowbtns.push({
                text: '编辑',
                fn: 'base_psersonalFiles.edit'
            });
            base_psersonalFiles.rowbtns.push({
                text: '删除',
                fn: 'base_psersonalFiles.del'
            });
            base_psersonalFiles.rowbtns.push({
                jstr: '<button class="btn btn-danger" onclick="base_psersonalFiles.check();">审核</button>'
            });

            base_psersonalFiles.toolbtns.push({
                text: '新增',
                fn: 'base_psersonalFiles.new'
            });
            base_psersonalFiles.toolbtns.push({
                text: '删除',
                fn: 'base_psersonalFiles.mdel'
            });
            base_psersonalFiles.toolbtns.push({
                jstr: '<button class="btn btn-danger" onclick="base_psersonalFiles.mcheck();">审核</button>'
            });

            //base_psersonalFiles.detailLink.push({
            //    tablename: 'table2',
            //    parentid: 'name',
            //    caption: 'tname',
            //    isActive: true
            //});

            base_psersonalFiles_init = base_psersonalFiles_init == undefined ? cusGrid() : function () {
                return base_psersonalFiles_init.reCreate();
            }();
            $.get('/api/base_psersonalFiles/get',
null ,
                    function (data) {
            base_psersonalFiles.data = data;
        base_psersonalFiles_init.init({
            data: base_psersonalFiles.data,
                detailLink: base_psersonalFiles.detailLink,
                    rowbtns: base_psersonalFiles.rowbtns,
                        toolbtns: base_psersonalFiles.toolbtns,
                            cols: base_psersonalFiles.cols,
                                isSelect:true,
                                tableName: 'base_psersonalFiles'
                            });
        base_psersonalFiles_init.initCard_mobile();
        });
        })
    </script>



</body>
</html>
